package com.steel.yfmall.cloud.assistant.controller;

import com.alibaba.fastjson.JSON;
import com.steel.yfmall.cloud.assistant.api.stock.ErpUserAccountsServiceAPI;
import com.steel.yfmall.cloud.assistant.bean.param.APIParamUserAccounts;
import com.steel.yfmall.cloud.assistant.bean.result.APIResultErpUserAccounts;
import com.steel.yfmall.cloud.components.utils.base.APIMsgBean;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @program: UserAccountsController
 * @author: liuzhijun
 * @date: 2021-03-23 20:18
 **/
@RestController
@Slf4j
public class ErpUserAccountsController {


    /**
     * 根据用户名+账户号码查询 账户运费余额 和账户余额
     *
     * @param apiParamUserAccounts
     * @return com.steel.yfmall.cloud.components.utils.base.APIMsgBean<com.steel.yfmall.cloud.assistant.bean.result.APIResultErpUserAccounts>
     * @author liuzhijun
     * @date 2021/4/2 18:04
     */
    @RequestMapping(value = "getUserAccountsMoneyInfo")
    public APIMsgBean<APIResultErpUserAccounts> getUserAccountsMoneyInfo(@RequestBody APIParamUserAccounts apiParamUserAccounts) {
        if (log.isDebugEnabled()) {
            log.info("function getUserAccountsMoneyInfo :" + JSON.toJSONString(apiParamUserAccounts));
        }
        return erpUserAccountsService.getUserAccountsMoneyInfo(apiParamUserAccounts);
    }

    @Resource
    private ErpUserAccountsServiceAPI erpUserAccountsService;
}
